<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfBuffer</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch02.html" title="Common libinfinity API">
<link rel="prev" href="libinfinity-0.4-InfProtocol.html" title="InfProtocol">
<link rel="next" href="ch03.html" title="Libinfinity's adOPTed implementation">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libinfinity-0.4-InfProtocol.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="ch03.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfBuffer.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#InfBuffer.description" class="shortcut">Description</a>
                   | 
                  <a href="#InfBuffer.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#InfBuffer.prerequisites" class="shortcut">Prerequisites</a>
                   | 
                  <a href="#InfBuffer.implementations" class="shortcut">Known Implementations</a>
                   | 
                  <a href="#InfBuffer.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="InfBuffer">
<a name="InfBuffer"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfBuffer.top_of_page"></a>InfBuffer</span></h2>
<p>InfBuffer — Abstract document interface</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfBuffer.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libinfinity/common/inf-buffer.h&gt;

                    <a class="link" href="InfBuffer.html#InfBuffer-struct" title="InfBuffer">InfBuffer</a>;
                    <a class="link" href="InfBuffer.html#InfBufferIface" title="InfBufferIface">InfBufferIface</a>;
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="InfBuffer.html#inf-buffer-get-modified" title="inf_buffer_get_modified ()">inf_buffer_get_modified</a>             (<em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="InfBuffer.html#inf-buffer-set-modified" title="inf_buffer_set_modified ()">inf_buffer_set_modified</a>             (<em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> modified</code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfBuffer.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GInterface
   +----InfBuffer
</pre>
</div>
<div class="refsect1" title="Prerequisites">
<a name="InfBuffer.prerequisites"></a><h2>Prerequisites</h2>
<p>
InfBuffer requires
 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>.</p>
</div>
<div class="refsect1" title="Known Implementations">
<a name="InfBuffer.implementations"></a><h2>Known Implementations</h2>
<p>
InfBuffer is implemented by
 <a class="link" href="InfChatBuffer.html" title="InfChatBuffer">InfChatBuffer</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="InfBuffer.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfBuffer.html#InfBuffer--modified" title='The "modified" property'>modified</a>"                 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfBuffer.description"></a><h2>Description</h2>
<p>
<a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> represents a document containing a session's content. It does
not cope with keeping its content in-sync with other participants but just
offers an interface to modify the document.
</p>
<p>
The <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> interface itself is probably not too useful, but actual
documents implementing functionality (such as text editing or graphics
editing) need to implement this interface to be passed to <a class="link" href="InfSession.html" title="InfSession"><span class="type">InfSession</span></a>.
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfBuffer.details"></a><h2>Details</h2>
<div class="refsect2" title="InfBuffer">
<a name="InfBuffer-struct"></a><h3>InfBuffer</h3>
<pre class="programlisting">typedef struct _InfBuffer InfBuffer;</pre>
<p>
<a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> is an opaque data type. You should only access it
via the public API functions.
</p>
</div>
<hr>
<div class="refsect2" title="InfBufferIface">
<a name="InfBufferIface"></a><h3>InfBufferIface</h3>
<pre class="programlisting">typedef struct {
  gboolean (*get_modified)(InfBuffer* buffer);

  void (*set_modified)(InfBuffer* buffer,
                       gboolean modified);
} InfBufferIface;
</pre>
<p>
The virtual methods of <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfBufferIface.get-modified"></a>get_modified</code></em> ()</span></p></td>
<td>Returns whether the buffer has been modified since the last
call to <em class="parameter"><code>set_modified</code></em> set modified flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="InfBufferIface.set-modified"></a>set_modified</code></em> ()</span></p></td>
<td>Set the current modified state of the buffer.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_buffer_get_modified ()">
<a name="inf-buffer-get-modified"></a><h3>inf_buffer_get_modified ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            inf_buffer_get_modified             (<em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>);</pre>
<p>
Indicates whether the buffer has been modified since the last call to
<a class="link" href="InfBuffer.html#inf-buffer-set-modified" title="inf_buffer_set_modified ()"><code class="function">inf_buffer_set_modified()</code></a> set the modification flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> Whether the buffer has been modified.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_buffer_set_modified ()">
<a name="inf-buffer-set-modified"></a><h3>inf_buffer_set_modified ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_buffer_set_modified             (<em class="parameter"><code><a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> modified</code></em>);</pre>
<p>
Sets the modification flag of <em class="parameter"><code>buffer</code></em> to <em class="parameter"><code>modified</code></em>. You should normally set
the flag to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> every time the document is saved onto disk. The buffer
itself will set it to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> when it has been changed.
</p>
<p>
To get notified when the modification flag changes, connect to
GObject::notify for the InfBuffer:modified property.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>A <a class="link" href="InfBuffer.html" title="InfBuffer"><span class="type">InfBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>modified</code></em> :</span></p></td>
<td>Whether the buffer is considered modified or not.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfBuffer.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "modified" property'>
<a name="InfBuffer--modified"></a><h3>The <code class="literal">"modified"</code> property</h3>
<pre class="programlisting">  "modified"                 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a>              : Read / Write</pre>
<p>Whether the buffer was modified since it has been saved.</p>
<p>Default value: FALSE</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>